﻿using Lists = Algoritmia.DataStructures.Lists;
using System;
using System.Collections.Generic;

namespace Algoritmia.Data
{
    public static class PolyominoesData
    {
        private static Tuple<T1,T2> CreateTuple<T1,T2>(T1 t1,T2 t2)
        {
            return new Tuple<T1, T2>(t1,t2);
        }

        public static Lists.IList<Tuple<char, IEnumerable<IEnumerable<Tuple<int, int>>>>> 
            Example
        {
           get
           {
               var list = new Lists.ArrayList<Tuple<char, IEnumerable<IEnumerable<Tuple<int, int>>>>>
                              {
                                  new Tuple<char, IEnumerable<IEnumerable<Tuple<int, int>>>>('I',
                                              new Lists.ArrayList<IEnumerable<Tuple<int, int>>>
                                                  {
                                                      new Lists.ArrayList<Tuple<int, int>>
                                                          {
                                                              CreateTuple(0, 0),
                                                              CreateTuple(1, 0),
                                                              CreateTuple(2, 0),
                                                              CreateTuple(3, 0)
                                                          },
                                                      new Lists.ArrayList<Tuple<int, int>>
                                                          {
                                                              CreateTuple(0, 0),
                                                              CreateTuple(0, 1),
                                                              CreateTuple(0, 2),
                                                              CreateTuple(0, 3)
                                                          }

                                                  }),
                                  new Tuple<char, IEnumerable<IEnumerable<Tuple<int, int>>>>('O', new Lists.ArrayList<IEnumerable<Tuple<int, int>>>
                                                       {
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(1, 0),
                                                                   CreateTuple(0, 1),
                                                                   CreateTuple(1, 1)
                                                               }
                                                       }),
                                  new Tuple<char, IEnumerable<IEnumerable<Tuple<int, int>>>>('L', new Lists.ArrayList<IEnumerable<Tuple<int, int>>>
                                                       {
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(1, 0),
                                                                   CreateTuple(2, 0),
                                                                   CreateTuple(2, 1)
                                                               },
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(0, -1),
                                                                   CreateTuple(0, -2),
                                                                   CreateTuple(1, -2)
                                                               },
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(-1, 0),
                                                                   CreateTuple(-2, 0),
                                                                   CreateTuple(-2, -1)
                                                               },
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(0, 1),
                                                                   CreateTuple(0, 2),
                                                                   CreateTuple(-1, 2)
                                                               },
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(0, -1),
                                                                   CreateTuple(0, -2),
                                                                   CreateTuple(-1, -2)
                                                               },
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(-1, 0),
                                                                   CreateTuple(-2, 0),
                                                                   CreateTuple(-2, -1)
                                                               },
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(0, 1),
                                                                   CreateTuple(0, 2),
                                                                   CreateTuple(1, 2)
                                                               },
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(1, 0),
                                                                   CreateTuple(2, 0),
                                                                   CreateTuple(2, -1)
                                                               }

                                                       }),
                                  new Tuple<char, IEnumerable<IEnumerable<Tuple<int, int>>>>('T', new Lists.ArrayList<IEnumerable<Tuple<int, int>>>
                                                       {
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(0, 1),
                                                                   CreateTuple(0, 2),
                                                                   CreateTuple(1, 1)
                                                               },
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(1, 0),
                                                                   CreateTuple(2, 0),
                                                                   CreateTuple(1, 1)
                                                               },
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(-1, 0),
                                                                   CreateTuple(-2, 0),
                                                                   CreateTuple(-1, -1)
                                                               },
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(0, 1),
                                                                   CreateTuple(0, 2),
                                                                   CreateTuple(-1, 1)
                                                               }
                                                       }),
                                  new Tuple<char, IEnumerable<IEnumerable<Tuple<int, int>>>>('Z', new Lists.ArrayList<IEnumerable<Tuple<int, int>>>
                                                       {
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(0, 1),
                                                                   CreateTuple(1, 1),
                                                                   CreateTuple(1, 2)
                                                               },
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(1, 0),
                                                                   CreateTuple(1, -1),
                                                                   CreateTuple(2, -1)
                                                               },
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(1, 0),
                                                                   CreateTuple(1, 1),
                                                                   CreateTuple(2, 1)
                                                               },
                                                           new Lists.ArrayList<Tuple<int, int>>
                                                               {
                                                                   CreateTuple(0, 0),
                                                                   CreateTuple(0, 1),
                                                                   CreateTuple(-1, 1),
                                                                   CreateTuple(-1, 2)
                                                               }
                                                       })
                              };

               return list; 
           }
        }

    }
}
